package jude.java.money.black;

import jude.java.money.beans.FtpSite;
import jude.java.money.provide.Provider;
import jude.java.money.task.BaseTask;
import jude.java.money.task.TaskContext;

public class PrintTask extends BaseTask<FtpSite> {

	private static int IDX;
	
	public PrintTask(Provider<FtpSite> provider) {
		super(provider);
	}
	
	@Override
	protected void execute(FtpSite site) {
		TaskContext.signal(1);
		System.out.println(getIDX() + "\t" + site.getHost());
		TaskContext.signal(2);
	}

	public synchronized static int getIDX() {
		return ++IDX;
	}
}
